package com.lxb.eduorder.client;

import com.lxb.commonutils.vo.EduCourseVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;

/**
 * @author xuebin.li
 * @createTime 2023/1/16 14:48
 */
//指定调用服务模块   定义容错的处理类
@FeignClient(value = "service-edu", fallback = EduClientImpl.class)
public interface EduClient {


    /**
     * 根据课程id，获取课程信息
     *
     * @param courseId
     * @return
     */
    @PostMapping("/eduservice/course/getCourseInfoVO/{courseId}")
    public EduCourseVo getCourseInfoVO(@PathVariable("courseId") String courseId);

    /**
     * 记录课程购买次数
     *
     * @param courseId
     * @return
     */
    @GetMapping("/eduservice/coursefront/addBuyCount/{courseId}")
    public boolean addBuyCount(@PathVariable("courseId") String courseId);
}
